{%  extends "index.html" %}  
{% block page_css %}  
{% endblock %}  
{% block page_title %}  
    任务信息  
{% endblock %}  
  
{% block container %}  
{% load staticfiles %}  
  
  
<div class="row">  
<!-- Search Page BEGINS-->  
<div class="col-xs-12">  
 <form class="navbar-for navbar-container" role="search" method="get" action="">{% csrf_token %}  
  
      <div class="col-sm-3">  
                        <div class="input-group">  
                            <span class="input-group-addon" id="task_code" >任务流水</span>  
                            <input type="text" class="form-control" placeholder="" aria-describedby="task_code" name="task_code"  
                                    {% if request.GET.task_code %}value = {{ request.GET.task_code }}{% endif %}>  
                        </div>  
                     </div>  
  
                     <div class="col-sm-3">  
                        <div class="input-group">  
                            <span class="input-group-addon" id="task_title">任务名称</span>  
                            <input type="text" class="form-control" placeholder="" aria-describedby="task_title" name = "task_title"  
                                    {% if request.GET.task_title %}value = {{ request.GET.task_title }}{% endif %}>  
                        </div>  
                     </div>  
  
  
                    <div class="col-sm-3">  
                        <div class="input-group">  
                            <span class="input-group-addon" id="task_signer">创建人员</span>  
                            <input type="text" class="form-control" placeholder="" aria-describedby="task_signer" name = "task_signer"  
                                    {% if request.GET.task_signer %}value = {{ request.GET.task_signer }}{% endif %}>  
                        </div>  
                     </div>  
  
                    <div class="col-sm-3">  
                        <div class="input-group">  
                            <span class="input-group-addon" id="task_contacts">联系人员</span>  
                            <input type="text" class="form-control" placeholder="" aria-describedby="task_contacts" name = "task_contacts"  
                                    {% if request.GET.task_contacts %}value = {{ request.GET.task_contacts }}{% endif %}>  
                        </div>  
                     </div>  
  
  
                    <div class="col-sm-3">  
                        <div class="input-group">  
                            <span class="input-group-addon" id="process_content">任务内容</span>  
                            <input type="text" class="form-control" placeholder="" aria-describedby="process_content" name = "process_content"  
                                    {% if request.GET.process_content %}value = {{ request.GET.process_content }}{% endif %}>  
                        </div>  
                     </div>  
  
  
                    <div class="col-sm-3">  
                         <div class="input-group">  
                             <span class="input-group-addon" id="task_category">任务分类</span>  
                             <select class="form-control" name="task_category">  
                                 <option value="">所有类型</option>  
                                 <option value="业务上线" {% if request.GET.task_category and request.GET.task_category == '业务上线'%} selected{% endif %}>业务上线</option>  
                                 <option value="业务下线" {% if request.GET.task_category and request.GET.task_category == '业务下线'%} selected{% endif %}>业务下线</option>  
                                 <option value="日常维护" {% if request.GET.task_category and request.GET.task_category == '日常维护'%} selected{% endif %}>日常维护</option>  
  
  
                            </select>  
                             </div>  
                    </div>  
  
                     <div class="col-sm-3">  
                         <div class="input-group">  
                             <span class="input-group-addon" id="task_status">任务状态</span>  
                             <select class="form-control" name="task_status">  
                                 <option value="处理中">处理中</option>  
                                 <option value="已结束" {% if request.GET.task_status and request.GET.task_status == '已结束'%} selected{% endif %}>已结束</option>  
                                 <option value="全部" {% if request.GET.task_status and request.GET.task_status == '全部'%} selected{% endif %}>全部</option>  
  
  
                            </select>  
                             </div>  
                    </div>  
  
  
  
  
<!-- /section:plugins/date-time.datepicker -->  
                    <div class="col-sm-4">  
  
  
                        <div class="input-daterange input-group">  
                            <span class="input-group-addon" id="date-picker">创建日期</span>  
                            <input type="text" class="form-control date-picker" name="task_start" data-date-format="yyyy-mm-dd" {% if request.GET.task_start %} value = {{ request.GET.task_start }}{% endif %}>  
                            <span class="input-group-addon">  
                                <i class="fa fa-exchange"></i>  
                            </span>  
  
                            <input type="text" class="form-control date-picker" name="task_end" data-date-format="yyyy-mm-dd" {% if request.GET.task_end %} value = {{ request.GET.task_end }}{% endif %}>  
                        </div>  
                     </div>  
  
  
  <div class="col-sm-3">  
                        <span class="input-group-btn">  
                           <button type="submit" class="btn btn-purple btn-sm">  
                              查询  
                              <i class="ace-icon fa fa-search icon-on-right bigger-110"></i>  
                           </button>  
  
  
                        </span>  
      </div>  
  
  
      </form>  
</div>  
  
<!-- Search Page END -->  
  
  
<!-- PAGE TABLES BEGINS -->  
  
  
                           <div class="col-xs-12">  
  
  
  
                              <div class="table-header">  
                                 {{ result }}  
  
  
  
                              </div>  
  
                              <div>  
                                 <table id="table_id" class="table table-striped table-bordered table-hover">  
                                    <thead>  
  
                                                       <th>流水号</th>  
                                                       <th>任务名称</th>  
                                                       <th>任务分类</th>  
                                                       <th>任务状态</th>  
                                                       <th>创建人</th>  
                                                       <th>创建时间</th>  
                                                <th>  
                                                    <a class="blue" href="{% url 'task_add'%}">  
                                                        <i class="ace-icon fa fa-search-plus bigger-130"></i>  
                                                        新建任务  
                                                    </a>  
  
                                                </th>  
  
  
  
                                    </thead>  
  
                                    <tbody>  
  
                                                {% for item in data %}  
                                       <tr>  
                                                       <td>{{ item.task_code }}</td>  
                                                       <td>{{ item.task_title }}</td>  
                                                       <td>{{ item.task_category }}</td>  
                                                       {% if item.task_status == '处理中' %}<td>处理中</td>{% endif %}  
                                                       {% if item.task_status == '已结束' %}<td>已结束</td>{% endif %}  
  
                                                       <td>{{ item.task_signer }}</td>  
                                                        <td>{{ item.task_signtime }}</td>  
                                          <td>  
                                             <div class="hidden-sm hidden-xs action-buttons">  
  
  
                                                 <a class="green" href="{% url 'task_edit' item.id %}" title="编辑任务">  
                                                   <i class="ace-icon fa fa-pencil bigger-130"></i>  
                                                </a>  
  
  
  
                                                                <a id="modal_button_{{ item.id }}" class="red" data-toggle="modal" href="#modal_form" rel="{% url 'task_delete' item.id %}" content="确认删除流水号为{{ item.task_code }}的任务么？" title="删除任务" >  
                                                   <i class="ace-icon fa fa-trash-o bigger-130"></i>  
                                                                </a>  
                                                                </div>  
  
  
  
  
  
  
  
  
                                             <div class="hidden-md hidden-lg">  
                                                <div class="inline position-relative">  
                                                   <button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown" data-position="auto">  
                                                      <i class="ace-icon fa fa-caret-down icon-only bigger-120"></i>  
                                                   </button>  
  
                                                   <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">  
                                                      <li>  
                                                         <a href="#" class="tooltip-info" data-rel="tooltip" title="View">  
                                                            <span class="blue">  
                                                               <i class="ace-icon fa fa-search-plus bigger-120"></i>  
                                                            </span>  
                                                         </a>  
                                                      </li>  
  
                                                      <li>  
                                                         <a href="#" class="tooltip-success" data-rel="tooltip" title="Edit">  
                                                            <span class="green">  
                                                               <i class="ace-icon fa fa-pencil-square-o bigger-120"></i>  
                                                            </span>  
                                                         </a>  
                                                      </li>  
  
                                                      <li>  
                                                         <a href="#" class="tooltip-error" data-rel="tooltip" title="Delete">  
                                                            <span class="red">  
                                                               <i class="ace-icon fa fa-trash-o bigger-120"></i>  
                                                            </span>  
                                                         </a>  
                                                      </li>  
                                                   </ul>  
                                                </div>  
                                             </div>  
                                          </td>  
  
  
  
                                       </tr>  
  
                                                    {% endfor %}  
                                    </tbody>  
                                 </table>  
                              </div>  
                                    {% include 'modal.html' %}  
  
                                    {% include 'pagination.html' %}  
                                    </div>  
  
  
  
  
  
</div>  
  
  
  
  
  
  
  
  
{% endblock %}  
  
  
  
{% block page_javascript %}  
    {% include 'modal_js.html' %}  
  
 <script type="text/javascript">  
  
        $(document).ready(function(){  
    $('#table_id').DataTable({  
        "paging":false,  
        "searching": false,  
        "bInfo": false,  
        "columnDefs": [ {  
                    "orderable": false, "targets": -1  
                    } ]  
    });  
    });  
      </script>  
  
  
  
  
<!--用于日期的前端显示-->  
  
 <script type="text/javascript">  
  
            jQuery(function($) {  
            //datepicker plugin  
            //link  
            $('.date-picker').datepicker({  
               autoclose: true,  
               todayHighlight: true,  
  
            })  
            //show datepicker when clicking on the icon  
            .next().on(ace.click_event, function(){  
               $(this).prev().focus();  
            });  
  
            //or change it into a date range picker  
            $('.input-daterange').datepicker({autoclose:true});  
  
  
            //to translate the daterange picker, please copy the "examples/daterange-fr.js" contents here before initialization  
            $('input[name=date-range-picker]').daterangepicker({  
               'applyClass' : 'btn-sm btn-success',  
               'cancelClass' : 'btn-sm btn-default',  
               locale: {  
                  applyLabel: 'Apply',  
                  cancelLabel: 'Cancel',  
               }  
            })  
            .prev().on(ace.click_event, function(){  
               $(this).next().focus();  
            });  
  
  
            $('#timepicker1').timepicker({  
               minuteStep: 1,  
               showSeconds: true,  
               showMeridian: false  
            }).next().on(ace.click_event, function(){  
               $(this).prev().focus();  
            });  
  
            $('#date-timepicker1').datetimepicker().next().on(ace.click_event, function(){  
               $(this).prev().focus();  
            });  
  
});  
      </script>  
{% endblock %}
